﻿@model CategoryWrapper
<div style="padding: 10px; overflow: auto;">
    <h3>
        <a href="@Model.PermaLink" target="_blank">
            <img style="border:0px;float: left;" src="@Url.Content("~/Content/Images/Publishing/full_page.png")"  alt="" />
            <span style="float: left; margin-top: 8px; color: #000000;">@Model.Title</span>
        </a>
    </h3>
</div>
@(Ajax.Dna().ListBox("ArticleList")
.HtmlAttributes(new { style = "width:auto;height:500px;border:none;" })
       .Bind(Url.Action("GetArticles", "Article", new { Area = "Publishing", id = Request.QueryString["id"] }))
       .ClientItemTemplate(@<text>
<li>
    <table style="width: 100%; border-bottom: 1px solid #cccccc;">
        <tr>
            <td style="vertical-align: top;">
                <input type="hidden" value="${ID}" />
                <a href="${PermaLink}" style="color: #000000;" target="_blank">
                    <img style="float: left; margin-right: 5px;" src="
                                                   {{if IsPrivate}}
                                                       @Url.Content("~/content/images/doc_draft.gif")
                                                   {{else}}
                                                      {{if !IsPublished}}
                                                         @Url.Content("~/content/images/doc_private.gif")
                                                      {{else}}
                                                          @Url.Content("~/content/images/doc_content.gif")
                                                      {{/if}}
                                                   {{/if}}
                                                   " alt="" />
                    <b><u><span>${Title}</span></u></b></a>
            </td>
            <td style="width: 100px; color: #000000; vertical-align: top;">
                {{= $dna.formatDate(Posted)}}
            </td>
        </tr>
        <tr>
            <td style="width: 550px; color: #858681; white-space: normal; padding: 5px 10px 5px 20px;"
                colspan="2">
                ${Summary}
            </td>
        </tr>
        <tr>
            <td>
                <table style="color: #858681;">
                    <tr>
                        <td>
                            @Html.Global("RES_AUTHOR"):
                        </td>
                        <td>
                            <a href="@Url.Content("~/sites/${UserName}/index.html")" class="d-user" target="_blank">
                                ${UserName}</a>
                        </td>
                        <td>
                            @Html.Global("publishing", "Comments"):
                        </td>
                        <td>
                            ${TotalComments}
                        </td>
                        <td>
                            @Html.Global("publishing", "Reads"):
                        </td>
                        <td>
                            ${TotalReads}
                        </td>
                        <td>
                            @Html.Global("publishing", "Ratings"):
                        </td>
                        <td>
                            ${TotalVotes}
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</li>
</text>)
      .GetHtml())
<script type="text/javascript">
    function movePage(actionUrl, ui) {
        var _pages = $(".articlemanageitem"),
        _pos = -1,
        __id = Number(ui.item.attr("aid"));
        if (_pages.length > 0)
            _pos = _pages.index(ui.item);
        var node = $('#CategoryTree').dtree("option", "selectedNode");
        $.post(actionUrl, { id: __id, pos: _pos });
    }
</script>
@Html.StartupScripts()
